using System;
using System.Collections.Generic;

namespace CMSApplication.Models
{
    public class HtmlElement
    {
        public HtmlElement()
        {
            //this.Contents = new List<Content>();
        }

        public HtmlElement(string _ElementType, string _WhereOnPage, string _InnerHtml, string _Style)
        {
            //this.Contents = new List<Content>();
            ElementID = DB.getNextId();
            ElementType = _ElementType;
            WhereOnPage = _WhereOnPage;
            ID = "";
            Name = "";
            Style = _Style;
            InnerHtml = _InnerHtml;
        }

        public int? ElementID { get; set; }
        public string WhereOnPage { get; set; } // header, sidebar, etc
        public string ElementType { get; set; }
        public string ID { get; set; }
        public string Name { get; set; }
        public string Style { get; set; }
        public string InnerHtml { get; set; }
        public virtual ICollection<Content> Contents { get; set; }

        public static ICollection<HtmlElement> getPageElements()
        {
            ICollection<HtmlElement> elements = new List<HtmlElement>();
            elements.Add(new HtmlElement("p", "content", "<strong>This is the first element</strong>",""));
            elements.Add(new HtmlElement("div", "leftsidebar", "<strong>This is the second element</strong>",""));
            elements.Add(new HtmlElement("div", "footer", "<strong>This is the third element</strong>",""));
            elements.Add(new HtmlElement("p", "rightsidebar", "<strong>This is the fourth element</strong>",""));
            elements.Add(new HtmlElement("h1", "header", "<strong>This is the fifth element</strong>",""));
            elements.Add(new HtmlElement("p", "content", "<img src='http://www-cs.stanford.edu/system/files/imagecache/research_spotlight/imagenet.jpg'>", "border: 2px solid;"));
        
            return elements;
        }

        public static bool AddElement(HtmlElement element)
        {
            // Add Element to database

            // End add

            return true;
        }
    }
}
